New applications are continually being added to electronic devices. For example, various electronic devices now include a camera unit for capturing images. The camera unit produces image data that is typically encoded using the JPEG standard to produce JPEG image data. In addition, uncompressed or raw thumbnail image data corresponding to the JPEG image data is generated and appended to the end of the JPEG data. The raw thumbnail image data is then processed and displayed on the display of the electronic device for viewing by the user. Images can be continually acquired by the camera, processed and displayed on the display in this manner while the user decides which image(s) to capture and store in the device memory.
The JPEG image data is variable length data since it has a variable data size based on the elements in the scene that is captured by the camera unit. For example, the size of the JPEG datasets that result from images captured for very different scenes or under conditions in which there is a great variation in the amount of light or noise in the scene can vary quite a bit. Accordingly, the JPEG image data can vary in size depending on the image of the scene that is captured by the camera unit or the conditions under which the image is captured. This can lead to some difficulties since processing variable length image data can be challenging in certain cases.